package com.itheima.tlias84.service.impl;

import com.itheima.tlias84.entity.Student;
import com.itheima.tlias84.mapper.StudentMapper;
import com.itheima.tlias84.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    StudentMapper studentMapper;
    @Override
    public List<Student> selectAllStudents() {
        List<Student> students = studentMapper.selectAllStudents();
        return students;
    }

    @Override
    public int insertStudent(Student student) {
        int flag = studentMapper.insertStudent(student);
        return flag;
    }

    @Override
    public int deleteStudentById(Integer id) {
        int flag = studentMapper.deleteStudentById(id);
        return flag;
    }

    @Override
    public int updateStudentById(Student student) {
        int flag = studentMapper.updateStudentById(student);
        return flag;
    }
}
